<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
	<head>

	</head>
	<body>
		<p>
			<s:form action="search" validate="false">
				<s:text name="label.search"/>: <input type="text" name="q" class="large" value="<s:property value="q"/>"/> <input type="submit" value="<s:text name="button.search"/>"/>
			</s:form>
		</p>

		<s:if test="genusDetails!=null && genera.size>0">
			<div id="left">
				<s:set name="browseUrlWORKING" value="'bingoTim'" scope="request"/>
				<s:url id="browseUrl" namespace="/genus" action="search"/>
				<s:action namespace="/taxa" name="open!open" executeResult="true" />
			</div>

			<div id="right">
				<p>
					<s:text name="nomenclaturalStanding.abbreviated"/>=<s:text name="nomenclaturalStanding"/>,
					<s:text name="sourceQualifier.abbreviated"/>=<s:text name="sourceQualifier"/>,
					<s:text name="completeness.abbreviated"/>=<s:text name="completeness"/>
				</p>
				<table class="searchResults">
					<tr class="th">
						<th><s:text name="nomenclaturalStanding.abbreviated"/></th>
						<th><s:text name="sourceQualifier.abbreviated"/></th>
						<th><s:text name="completeness.abbreviated"/></th>
						<th><s:text name="label.scientificName"/></th>
						<th><s:text name="ICZN.abbreviated"/></th>
						<th><s:text name="ICBN.abbreviated"/></th>
						<th><s:text name="ICNB.abbreviated"/></th>
						<th><s:text name="label.citation"/></th>
						<th><s:text name="label.sources"/></th>
						<th><s:text name="label.comment"/></th>
					</tr>
					<s:iterator value="genusDetails">
							<s:if test="homonym">
								<tr class="homonym">
							</s:if>
							<s:else>
								<tr>
							</s:else>

							<!--  nomenclature standing -->
							<s:if test="nomenclatureStandingPercent <= 33 ">
								<td class="red"/>
							</s:if>
							<s:elseif test="nomenclatureStandingPercent > 33 && nomenclatureStandingPercent<=66">
								<td class="yellow"/>
							</s:elseif>
							<s:else>
								<td class="green"/>
							</s:else>

							<!--  source qualifier -->
							<s:if test="sourceQualifierPercent <= 33 ">
								<td class="red"/>
							</s:if>
							<s:elseif test="sourceQualifierPercent > 33 && sourceQualifierPercent<=66">
								<td class="yellow"/>
							</s:elseif>
							<s:else>
								<td class="green"/>
							</s:else>

							<!--  completeness -->
							<s:if test="completenessPercent <= 33 ">
								<td class="red"/>
							</s:if>
							<s:elseif test="completenessPercent > 33 && completenessPercent">
								<td class="yellow"/>
							</s:elseif>
							<s:else>
								<td class="green"/>
							</s:else>

							<td>
								<s:url action="detail" id="detailUrl">
									<s:param name="id" value="genus.id"/>
								</s:url>
								<s:a href="%{detailUrl}" cssClass="nameLink"><i><s:property value="genus.canonical"/></i></s:a>
								 <s:if test="genus.authorship!=null">
									<s:property value="genus.authorship"/>
								</s:if>
							</td>
							<td class="center">
								<s:if test="iczn">
									<input type="checkbox" checked="true" disabled="true">
								</s:if>
							</td>
							<td class="center">
								<s:if test="icbn">
									<input type="checkbox" checked="true" disabled="true">
								</s:if>
							</td>
							<td class="center">
								<s:if test="icnb">
									<input type="checkbox" checked="true" disabled="true">
								</s:if>
							</td>
							<td/>
							<td class="center">
								<s:url action="search" id="remoteUrl"/>
								<s:iterator value="genus.genusUsages">
									<s:a href="%{remoteUrl}" cssClass="nameLink"><s:property value="agiDatasource.nameAbbreviated"/></s:a>
								</s:iterator>
							</td>
							<td class="center">
								<img src="<s:url value="/images/comment_add.png"/>"/>
							</td>
						</tr>
					</s:iterator>
				</table>
				<p>
					Key:
				</p>
				<p>
					<table class="searchResults">
						<tr>
							<td class="homonym">&nbsp;&nbsp;&nbsp;</td>
							<td>Homonym</td>
						</tr>
					</table>
				</p>
				<p>
					<table class="searchResults">
						<tr class="th">
							<th></th>
							<th><s:text name="nomenclaturalStanding"/> (<s:text name="nomenclaturalStanding.abbreviated"/>)</th>
						</tr>
						<tr>
							<td class="red">&nbsp;&nbsp;&nbsp;</td>
							<td><s:text name="nomenclaturalStanding.red"/></td>
						</tr>
						<tr>
							<td class="yellow"></td>
							<td><s:text name="nomenclaturalStanding.yellow"/></td>
						</tr>
						<tr>
							<td class="green"></td>
							<td><s:text name="nomenclaturalStanding.green"/></td>
						</tr>
					</table>
				</p>
				<p>
					<table class="searchResults">
						<tr class="th">
							<th></th>
							<th><s:text name="sourceQualifier"/> (<s:text name="sourceQualifier.abbreviated"/>)</th>
						</tr>
						<tr>
							<td class="red">&nbsp;&nbsp;&nbsp;</td>
							<td><s:text name="sourceQualifier.red"/></td>
						</tr>
						<tr>
							<td class="yellow">&nbsp;&nbsp;&nbsp;</td>
							<td><s:text name="sourceQualifier.yellow"/></td>
						</tr>
						<tr>
							<td class="green"></td>
							<td><s:text name="sourceQualifier.green"/></td>
						</tr>
					</table>
				</p>
				<p>
					<table class="searchResults">
						<tr class="th">
							<th></th>
							<th><s:text name="completeness"/> (<s:text name="completeness.abbreviated"/>)</th>
						</tr>
						<tr>
							<td class="red">&nbsp;&nbsp;&nbsp;</td>
							<td><s:text name="completeness.red"/></td>
						</tr>
						<tr>
							<td class="yellow"></td>
							<td><s:text name="completeness.yellow"/></td>
						</tr>
						<tr>
							<td class="green"></td>
							<td><s:text name="completeness.green"/></td>
						</tr>
					</table>
				</p>
			</div>
		</s:if>
	</body>
</html>
